package VN.EDU.IMIC.DEVELOPER.DOTHANHTUNG.OOP_MVC_LV1.Calculator;

import java.util.Scanner;

public class CalculatorView {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//khoi tao doi tuong
		double numA, numB, Result;
		int PhepTinh;
		System.out.println("Please enter number A");
		Scanner sc = new Scanner(System.in);
		numA = sc.nextDouble();
		System.out.println("Please enter number B");
		numB = sc.nextDouble();
		System.out.println("Please enter operator (1 = '+', 2 = '-', 3 = '/', 4 = '*')");
		PhepTinh = sc.nextInt();
		
		//set value for object
		Calculator operator = new Calculator();
		operator.setA(numA);
		operator.setB(numB);
		operator.setiOpt(PhepTinh);
		
		//khoi tao controller
		
		CalculatorController objcontroller = new CalculatorController(operator);
		
		if (objcontroller.CalculatorValidate() == "success"){
			Result = objcontroller.CalculatorInfo();
			System.out.println("Ket qua la " + Result);
		}
	}

}
